<!-- 在线网页编辑器引入 -->
<link rel="stylesheet" href="/static/kindeditor/themes/default/default.css" />
<script src="/static/kindeditor/kindeditor-all-min.js"></script>
<script src="/static/kindeditor/lang/zh-CN.js"></script>
<script>
  var editor;
  KindEditor.ready(function(K){
    editor = K.create('textarea[name="content"]', {
      allowFileManager : true
    });
  })
</script>



<div class="layui-container fly-marginTop">
  <div class="fly-panel" pad20 style="padding-top: 5px;">
    {if condition="$LoginUser.auth > 0"}
      <div class="layui-form layui-form-pane">
        <div class="layui-tab layui-tab-brief" lay-filter="user">
          <ul class="layui-tab-title">
            <li class="layui-this">编辑帖子</li>
          </ul>

          <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
            <div class="layui-tab-item layui-show">
              <form method="post">
                <!-- 分类和标题 -->
                <div class="layui-row layui-col-space15 layui-form-item">
                  <div class="layui-col-md3">
                    <label class="layui-form-label">所在专栏</label>
                    <div class="layui-input-block">
                      <select name="cateid">
                        {foreach $catelist as $item}
                        <option {$post['cateid'] == $item['id'] ? 'selected' : ''} value="{$item.id}">{$item.name}</option>
                        {/foreach}
                      </select>
                    </div>
                  </div>

                  <!-- 标题 -->
                  <div class="layui-col-md9">
                    <label for="title" class="layui-form-label">悬赏标题</label>
                    <div class="layui-input-block">
                      <input type="text" id="title" name="title" required lay-verify="required" class="layui-input" value="{$post.title}" placeholder="请输入悬赏标题" />
                    </div>
                  </div>
                </div>

                <!-- 帖子正文内容 -->
                <div class="layui-form-item layui-form-text">
                  <div class="layui-input-block">
                    <textarea id="content" name="content" placeholder="详细描述" class="layui-textarea" style="height: 260px;">{$post.content}</textarea>
                  </div>
                </div>

                <!-- 验证码 -->
                <div class="layui-form-item">
                  <label for="vercode" class="layui-form-label">验证码</label>
                  <div class="layui-input-inline">
                    <input type="text" id="vercode" name="vercode" required placeholder="请输入验证码" class="layui-input">
                  </div>

                  <div class="layui-form-mid">
                    <span style="color: #c00;">
                      <img src="{:url('home/index/captcha')}" onclick="this.src=`{:url('home/index/captcha')}`" style="width: 150px;height: 40px;" />
                    </span>
                  </div>
                </div>

                <!-- 提交 -->
                <div class="layui-form-item">
                  <button class="layui-btn" type="submit">立即修改</button>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    {else /}
      <div class="fly-none">没有权限</div>
    {/if}    
  </div>
</div>
